import request from "../request";

// 发送手机/邮箱验证码 1:手机 2:邮箱
function sendVcode(query) {
    return request.get('/api/account/sendVcode', query, false)
}

// 邮箱手机号注册
function registerByVcode(query) {
    return request.post('/api/account/registerByVcode', query, {}, false)
}

function registerByEmail(query) {
    return request.post('/api/account/registerByEmail', query, {}, false)
}

// 登录
function loginByPassword(data) {
    return request.post('/api/account/loginByPassword', data, {}, false)
}

// 登录
function loginByVcode(data) {
    return request.post('/api/account/loginByVcode', data, {}, false)
}

function checkVcode(data) {
    return request.post('/api/account/checkVcode', data, {}, false)
}

//忘记密码
function resetPassword(data) {
    return request.post('/api/account/resetPassword', data, {}, false)
}

//tg登录
function loginByTelegram(data) {
    return request.post('/api/account/loginByTelegram', data, {}, false)
}

//tg绑定
function bindTelegram(data) {
    return request.post('/api/account/bindTelegram', data, {}, false)
}

//tg绑定
function logout() {
    return request.post('/api/account/logout')
}

function info() {
    return request.get('/api/account/info')
}

function updateInfo(query) {
    return request.post('/api/account/updateInfo', query)
}

function changePassword(query) {
    return request.post('/api/account/changePassword', query)
}

function resetTransactionPassword(query) {
    return request.post('/api/account/resetTransactionPassword', query)
}

function changeEmail(query) {
    return request.post('/api/account/changeEmail', query)
}

// 绑定邮箱
function bindEmail(data) {
    return request.post('/api/account/bindEmail', data)
}

// 发送绑定手机验证码
function sendBindMobileVcode(data) {
    return request.get('/api/account/sendBindMobileVcode', data)
}

// 绑定手机
function bindMobile(data) {
    return request.post('/api/account/bindMobile', data)
}

// 修改手机号
function changeMobile(data) {
    return request.post('/api/account/changeMobile', data)
}

export default {
    info,
    updateInfo,
    changePassword,
    resetTransactionPassword,
    changeEmail,
    sendVcode,
    registerByVcode,
    registerByEmail,
    loginByPassword,
    loginByVcode,
    checkVcode,
    resetPassword,
    loginByTelegram,
    bindTelegram,
    logout,
    bindEmail,
    sendBindMobileVcode,
    bindMobile,
    changeMobile
}